using DevExpress.XtraEditors;
using DevExpress.XtraGrid;

namespace CSW.Framework.UI.DevEx.UserControls
{
    /// <summary>
    /// DXBaseSearchUserControl
    /// </summary>
    public partial class DXBaseSearchUserControl : XtraUserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DXBaseSearchUserControl"/> class.
        /// </summary>
        public DXBaseSearchUserControl()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Occurs when a grid row is double clicked.
        /// </summary>
        public event RowDoubleClickEventHandler GridRowDoubleClick
        {
            add { grid.RowDoubleClick += value; }
            remove { grid.RowDoubleClick -= value; }
        }

        /// <summary>
        /// Gets the grid control.
        /// </summary>
        /// <value>The grid control.</value>
        public GridControl GridControl
        {
            get { return grid; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the edit buttons panel is visible.
        /// </summary>
        /// <value><c>true</c> if the edit buttons panel is visible; otherwise, <c>false</c>.</value>
        public bool EditButtonsPanelVisible
        {
            get { return resultsButtonsPanel.Visible; }
            set { resultsButtonsPanel.Visible = value; }
        }
    }
}